//
// Created by Tiany on 2021/6/17.
//

#ifndef SHUJUJIEGOU_SEQLIST_H
#define SHUJUJIEGOU_SEQLIST_H

struct DataType {
    int n;
};
struct SeqList {
    int MAXNUM;//表最大长度
    int n;//表中元素个数
    struct DataType *element;
};
typedef struct SeqList *PSeqList;

//创建空顺序表
PSeqList createNullList_seq(int n);

//将数据写入顺序表
PSeqList writeList_seq(PSeqList pSeqList, struct DataType x[], int length);

//判断顺序表是否为空
int isNullList_seq(PSeqList pSeqList);

//求某元素的下标
int locate_seq(PSeqList pSeqList, struct DataType x);

//在下标为p元素之前插入元素x
int insertPre_seq(PSeqList pSeqList, int p, struct DataType x);

//在下标为p元素后插入元素x
int insertPost_seq(PSeqList pSeqList, int p, struct DataType x);

//删除下标为p的元素
int deleteP_seq(PSeqList pSeqList, int p);

//删除元素x
int deleteV_seq(PSeqList pSeqList, struct DataType x);

//删除所有元素x
int deleteAllV_seq(PSeqList pSeqList,struct DataType x);

/*//获取数组长度
int getDataLength(Data x[]);*/

//读取并打印顺序表
void readList_seq(PSeqList pSeqList);

//将顺序表逆置
void sortSeq(PSeqList pSeqList);

#endif //SHUJUJIEGOU_SEQLIST_H
